import 'element-plus/es/components/notification/style/css'
import {ElNotification} from 'element-plus'

// 安装 按需引入情况下支持$notify方法
const ElementPlusNotify = {
  install: (app) => {
    let notification = (op) => {
      return ElMessage(op)
    }
    notification.success = (op) => {
      return ElNotification.success(op)
    }
    notification.warning = (op) => {
      return ElNotification.warning(op)
    }
    notification.error = (op) => {
      return ElNotification.error(op)
    }
    notification.info = (op) => {
      return ElNotification.info(op)
    }
    app.config.globalProperties.$notify = notification
  }
}

export default ElementPlusNotify